//
//  CellOfOneImg.m
//  ProjectA_ManualGuest
//
//  Created by dingcong on 16/6/17.
//  Copyright © 2016年 丁聪. All rights reserved.
//

#import "CellOfOneImg.h"
#import "PrefixHeader.pch"
#import "Masonry.h"
#import "UIImageView+WebCache.h"
@implementation CellOfOneImg

- (void)dealloc{
    
    [super dealloc];
    [_bigImage release];
    [_lableOfImage release];
    [_model release];
  
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
    {
        [self creat];
    }
    
    return self;
    
    
    
}

- (void)creat{
    
    self.bigImage = [[UIImageView alloc]init];
    
//    self.bigImage.backgroundColor = [UIColor redColor];
    
    [self.contentView addSubview:self.bigImage];
    
    [self.bigImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView.mas_top).offset(5);
        make.leading.equalTo(self.contentView.mas_leading).offset(8);
        make.height.equalTo(self.contentView.mas_height).offset(- 10);
        make.width.equalTo(self.contentView.mas_width).offset(- 18);
        
        
        
    }];
    
    [self.bigImage release];
    
    
    self.lableOfImage = [[UILabel alloc]init];
    
//    self.lableOfImage.backgroundColor = [UIColor greenColor];
    
    [self.contentView addSubview:self.lableOfImage];
    
    [self.lableOfImage mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.leading.equalTo(self.bigImage.mas_leading).offset(5);
        make.bottom.equalTo(self.bigImage.mas_bottom).offset(- 5);
        make.width.offset(SCREEN_WIDTH - 26);
        make.height.offset(20);
        
    }];
    
    self.lableOfImage.font = [UIFont systemFontOfSize:15];
    self.lableOfImage.textColor = [UIColor whiteColor];
    self.lableOfImage.text = @"sdflkjsdlfkjklsjdfkljklsdjfkldjsf";
    [self.lableOfImage release];
    
}

- (void)setModel:(ModelOfMaterial *)model{
    
    [self.bigImage sd_setImageWithURL:[NSURL URLWithString:model.host_pic]placeholderImage:nil];
        
        self.lableOfImage.text = model.topic_name;
    NSLog(@"%@", model.mob_h5_url);
    
    
    
}

@end
